<!--代码逻辑和样式库-->
<script src="./dictionary-list.component.js"></script>
<style src="./dictionary-list.scss" scoped lang="scss"></style>

<template>
  <div>
    <!-- 内容区域 -->
    <div class="content-container">
      <div><strong>字典管理</strong> <i class="el-icon-arrow-right"></i> 字典详情 <i class="el-icon-arrow-right"></i> {{ table.typeName }}</div>
      <div class="aq-padding-top-16 aq-padding-bottom-16">
        <el-button v-waves v-if="userInfo.userId === '-1'" type="success" @click="openCreateOrEditDialog()">创建字典名称</el-button>
        <el-button v-waves v-if="codesCheck.indexOf('Delete') !== -1" type="danger" @click="deleteSelectedData()">批量删除</el-button>
      </div>
      <el-table v-loading="loading" :data="data" border fit highlight-current-row @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" fixed></el-table-column>
        <el-table-column prop="itemName" label="字典标签" />
        <el-table-column prop="itemValue" label="字典键值" />
        <el-table-column prop="remark" label="备注" />
        <el-table-column prop="createTime" label="创建时间" />
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button v-if="codesCheck.indexOf('Edit') !== -1" plain size="mini" type="primary" @click="openCreateOrEditDialog(scope.row)">编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页插件 -->
      <pagination v-show="totalNum > 0" :total="totalNum" :page.sync="pageNum" :limit.sync="recordNum" @pagination="getDataList" />
    </div>
    <create-dictionary v-if="createOrEditDialogVisible" :dic-id="selectDicId" :table-name="table.tableName" @reload="reload()" @close="closeCreateOrEditDialog"></create-dictionary>
  </div>
</template>
